package com.epam.kulibaba.components.catalog.navigator;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import com.epam.kulibaba.components.Component;

public class CatalogNavigatorPager extends Component {
	public static final String FIRSTPAGE = ".//ul[@class = 'pager']/li[3]/a";
	public static final String LASTPAGE = ".//ul[@class = 'pager']/li[@class = 'pager-last last']/a";
	public static final String LINKFORWARD = ".//ul[@class = 'pager']/li[2]/a";
	@FindBy(xpath = CatalogNavigatorPager.FIRSTPAGE)
	private WebElement firstPage;
	
	@FindBy(xpath = CatalogNavigatorPager.LASTPAGE)
	private WebElement lastPage;
	
	@FindBy(xpath = CatalogNavigatorPager.LINKFORWARD)
	private WebElement linkForward;
	
	public WebElement getFirstPage() {
		return firstPage;
	}

	public WebElement getLastPage() {
		return lastPage;
	}
	
	public WebElement getButtonForward() {
		return linkForward;
	}
	
	public CatalogNavigatorPager getCatalogPages(WebDriver driver) {
		CatalogNavigatorPager catalogPages = PageFactory.initElements(driver,
				CatalogNavigatorPager.class);
		return catalogPages;
	}
}
